import type { AppRouteModule } from '/@/router/types';

import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';
import { useGlobSetting } from '/@/hooks/setting';
const { shortName } = useGlobSetting();

const QuesLibRoute: AppRouteModule = {
  path: '/quesLib',
  name: 'QuesLib',
  component: LAYOUT,
  redirect: '/quesLib/index',
  meta: {
    icon: 'simple-line-icons:layers',
    title: t('问题详情'),
    orderNo: 100000,
  },
  children: [
    {
      path: 'index',
      name: 'QuesLibIndex',
      component: () => import('/@/views/quesLib/index.vue'),
      meta: {
        icon: 'ion:list-box-outline',
        title: t('问题库'),
      },
    },
    {
      path: 'form',
      name: 'QuesLibForm',
      component: () => import('/@/views/quesLib/form.vue'),
      meta: {
        icon: 'ion:list-box-outline',
        title: t('问题详情'),
      },
    },
    {
      path: 'help',
      name: 'QuesLibReadme',
      target: '_blank',
      meta: {
        icon: 'ion:list-box-outline',
        title: t('帮助文档'),
        frameSrc: `/${shortName}/static/quesLibReadme/quesLibReadme.html`,
      },
    },
  ],
};

export default QuesLibRoute;
